<template>
	<div id="record">
		<mt-navbar v-model="selected">
			<mt-tab-item id="1">保护中</mt-tab-item>
			<mt-tab-item id="2">已完成</mt-tab-item>
		</mt-navbar>
		<!-- tab-container -->
		<mt-tab-container v-model="selected">
			<mt-tab-container-item id="1">
				<!--<mt-cell v-for="n in 10" :title="'content ' + n" />-->
				<mt-cell :title="title" label="5月18日 22:00/23:00">
					<span>已完成</span>
				</mt-cell>
			</mt-tab-container-item>
			<mt-tab-container-item id="2">
				<!--<mt-cell v-for="n in 4" :title="'content ' + n" />-->
			</mt-tab-container-item>
		</mt-tab-container>
	</div>
</template>

<script>
	import { Navbar, TabItem } from 'mint-ui'

	export default {
		name:'protectRecord',
		data() {
			let pageNum = 0;
			let pageSize = 10;
			return{
				selected: '',
				title: '起始点a-结束点b'
			}
		},
		methods:{
			getList(){
				//			3获取我的保护记录
//http://localhost:8083/app/user/getProtectLog
//userToken=0c3d459c-658a-46dd-b93b-bedca5e6af0b&pageNum=0&pageSize=10
//{"result":true,"code":200,"errorMessage":null,"response":[{"id":1,"userId":1,"phone":"13522638835","lon":2.234234,"lat":4.23423,"time":0.5,"isAdd":0,"addTime":0.0,"startAddress":"北京市朝阳区阜通东大街222号","endAddress":"天启大厦","createTime":1526613570431,"flag":2,"updateTime":null}]}
//
//注意：pageNum从0开始不断+1，pageSize永远为10
//				let params = new URLSearchParams();
//				params.append('userToken',JSON.parse(window.localStorage.getItem('info').userToken));
//				params.append('pageNum',0);
//				params.append('pageSize',10);
//				this.$http.post('/getProtectLog',params).then( res => {
//					if(res.code == 200 && res.errorMessage == null){
//						
//						console.log(res)
//					}else{
//						Toast(res.errorMessage);
//					}
//				}).catch( error => {
//					console.log(error)
//				})
			}
		},
		mounted(){
			this.getList()
		}
	}
</script>

<style>
	#record .mint-cell-title{
		text-align: left;
	}
	#record .mint-navbar .mint-tab-item{
		padding: .3rem 0
	}
	#record .mint-tab-item-label{
		font-size: .34rem;
		padding: .06rem 0;
	}
	#record .mint-tab-item:nth-of-type(1) .mint-tab-item-label{
		border-right: 1px solid #ccc;
	}
	#record .mint-tab-container{
		border-top: .2rem solid #f7f7f7;
	}
</style>
<style scoped>
	
</style>